package cn.rongdao.jrkabao.model.login;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 17/5/5
 */

public class GetCodeModel extends BaseKaMaoModel {

    public static GetCodeModel getInstance() {
        return getPresent(GetCodeModel.class);
    }

    public void execute(String phone, String type, Observer<String> observer) {
        addParamStrings("phone", FRString.valueOf(phone));
        addParamStrings("type", FRString.valueOf(type));
        Observable<String> observable = mServletApi.getPhoneCode(mParams).map(new HttpFunction<String>());
        toSubscribe(observable, observer);
    }
}